Release 10.1A: OpenEdge Development:
Progress 4GL Reference
BUFFER-COMPARE( ) method
This method does a rough compare of any common fields, determined by name, data type, and extent-matching, between the source buffer and the target buffer. The resulting logical value is either TRUE or FALSE as a whole. A single field that does not compare causes the entire buffer to return FALSE. If there are fields in one buffer that do not exist in the other, they are ignored.
Return type: LOGICAL Applies to: Buffer object handle
source-buffer-handleAn expression that evaluates to a buffer handle.
mode-expIf
mode-expis given, it must evaluate to either “binary” or “case-sensitive” to provide that type of comparison.except-listA character expression that evaluates to a comma-separated list of field names to be excluded from the compare.
pairs-listA character expression that evaluates to a comma-separated list of field-name pairs to be compared.
You can specify an array element as one or both of the fields. This lets you compare a field or array element in one buffer to a field or array element in the other buffer, when the two fields do not have the same name. The order within each field-name pair does not matter; each pair must contain one field name from the source and one field name from the target.
You can also compare one entire array to another by specifying its name without a subscript.
no-lobsA logical expression indicating whether to ignore BLOB and CLOB fields in the compare. If TRUE, BLOB and CLOB fields are ignored during the compare. If FALSE, BLOB and CLOB fields are compared along with the other fields. The default value is FALSE (that is, BLOB and CLOB fields are included in the compare).
Note: You cannot use the BUFFER-COMPARE( ) method to compare records that contain CLOB fields, unless one or both of the corresponding fields contain the Unknown value (?); Progress generates a run-time error. However, you can convert CLOB fields to LONGCHAR values and use the EQ, GE, GT, LE, LT, and NE comparison operators, or the COMPARE function, to compare the LONGCHAR values.If you want to compare BLOB fields only, you can set this option to FALSE and use the
except-listoption to exclude CLOB fields from the compare.The following example fragment does a binary compare of two fields, one from each buffer:
Notes
- When comparing buffers in a ProDataSet object, Progress checks as to whether the BUFFER-COMPARE( ) method satisfies the following two requirements:
- The compare is between a buffer on a Data-source object table and the corresponding ProDataSet temp-table buffer. This means the operation can use any buffer for the data source database table, but only the default buffer for the ProDataSet temp-table.
- There are no
except-listorpairs-listarguments for the BUFFER-COMPARE( ) method.If these two requirements are satisfied, the BUFFER-COMPARE( ) method identifies the
fields to compare based on thepairs-listargument specified in the ATTACH-DATA-SOURCE( ) method for the Data-source object, if any, along with either theexcept-listorinclude-listarguments, if any. Because the ATTACH-DATA-SOURCE( ) method already allows you to define a field mapping between a Data-source object buffer and a ProDataSet temp-table buffer, as well as a list of fields to include or exclude from the operation, you do not need to specify these in the BUFFER-COMPARE( ) method.- When comparing records that contain BLOB fields, Progress performs a binary comparison on the BLOB data associated with the source and target records.
- Use the
no-lobsoption with the BUFFER-COMPARE( ) method to ignore large object data when comparing records that contain BLOB or CLOB fields. You can also use theexcept-listoption to exclude BLOB and CLOB fields from the compare.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |